from app.schemas.common import _Page, BaseModel, Field, List


class PrizeGrade(BaseModel):
    grade: int = Field(..., title='奖项等级')
    bonus: str = Field(..., title='奖金金额')
    number: str = Field(..., title='中奖人数')


class Lottery(BaseModel):
    """书籍信息"""
    id: str = Field(..., title='期数')
    date: str = Field(..., title='开奖日期')
    blue: str = Field(..., title='红球')
    red: List[str] = Field(..., title='蓝球')
    poolmoney: str = Field(..., title='奖池金额')
    prizegrade: List[PrizeGrade] = Field(..., title='奖项')


class _QKeyWord(BaseModel):
    id: str = Field(None, title='期数', alias='_id')
    date: str = Field(None, title='开奖日期')


class Query(_Page):
    q: _QKeyWord = Field(None, title='查询条件')


class Phase(BaseModel):
    id: str = Field(None, title='期数', alias='_id')
